from django.urls import path
from .views import (
    CommentListView, CommentCreateView, CommentDetailView,
    CommentAdminListView, CommentAdminUpdateView,
    CommentReportCreateView, CommentReportListView,
    CommentReportUpdateView, CommentReplyCreateView,
    comment_vote, user_comments, comment_stats
)

urlpatterns = [
    path('comments/', CommentListView.as_view(), name='comment-list'),
    path('comments/create/', CommentCreateView.as_view(), name='comment-create'),
    path('comments/<int:pk>/', CommentDetailView.as_view(), name='comment-detail'),
    path('admin/comments/', CommentAdminListView.as_view(), name='comment-admin-list'),
    path('admin/comments/<int:pk>/', CommentAdminUpdateView.as_view(), name='comment-admin-update'),
    
    path('books/<int:book_id>/comments/', CommentListView.as_view(), name='book-comments'),
    path('comments/<int:comment_id>/replies/', CommentReplyCreateView.as_view(), name='comment-reply-create'),
    path('comments/<int:comment_id>/vote/', comment_vote, name='comment-vote'),
    
    path('comments/<int:comment_id>/report/', CommentReportCreateView.as_view(), name='comment-report-create'),
    path('admin/comment-reports/', CommentReportListView.as_view(), name='comment-report-admin-list'),
    path('admin/comment-reports/<int:pk>/', CommentReportUpdateView.as_view(), name='comment-report-admin-update'),
    
    path('user/comments/', user_comments, name='user-comments'),
    path('admin/comment-stats/', comment_stats, name='comment-stats'),
]
